import { HttpGet, HttpPost } from '@/api/index.js'

/**
 * 新增
 * @param data
 */
export const add = (data) => {
    return HttpPost('/admin/schedule/add', data)
}

/**
 * 根据ID删除
 * @param id
 */
export const deleteById = (id) => {
    return HttpPost('/admin/schedule/delete/' + id)
}

/**
 * 更新
 * @param data
 */
export const update = (data) => {
    return HttpPost('/admin/schedule/update', data)
}

/**
 * 分页列表
 * @param data
 */
export const pageLit = (data) => {
    return HttpGet('/admin/schedule/pageList', data)
}

/**
 * 执行一次执行任务
 * @param id
 */
export const runOnce = id => {
    return HttpPost('/admin/schedule/runOnce/' + id)
}

/**
 * 运行指定任务
 * @param id
 */
export const run = id => {
    return HttpPost('/admin/schedule/run/' + id)
}

/**
 * 暂时指定任务
 * @param id
 */
export const pause = id => {
    return HttpPost('/admin/schedule/pause/' + id)
}

/**
 * 任务日志列表
 * @param data
 */
export const logPageList = data => {
    return HttpGet('/admin/schedule/log/pageList', data)
}
